define(["../common"], function() {

	$("#showTip").prop("checked", Common.getLocalStorage("isShowNewOrderTip") === "false" ? false : true);
	$("#playAudio").prop("checked", Common.getLocalStorage("isPlayNewOrderAudio") === "false" ? false : true);

	$("#showTip").click(function() {
	
		var isChecked = $(this).prop("checked");
		
		Common.setLocalStorage("isShowNewOrderTip", "" + isChecked);
		
		$("#playAudio").prop("disabled", !isChecked);
		
		$(document).trigger('newOrderTipSwitch.change');
		
	});
	
	$("#playAudio").click(function() {
	
		Common.setLocalStorage("isPlayNewOrderAudio", $(this).prop("checked") ? "true" : "false");
		
		$(document).trigger('newOrderAudioSwitch.change');
	});
	
});
